﻿using System;
using System.Collections.Generic;
using System.Web;

using mvcForum.Core.Interfaces.Search;
using mvcForum.SearchProvider.Lucene.Indexes;
using mvcForum.Core.Interfaces.DependencyManagement;

namespace mvcForum.SearchProvider.Lucene {

	public class LuceneSearchBuilder : LuceneBaseSearchBuilder {

		public override void Configure(IDependencyContainer container) {
			// Let's just use a regular file-system directory!
			IDirectoryResolver dirResolver = new FileSystemDirectoryResolver(HttpContext.Current.Server.MapPath("~/app_data"));
			container.RegisterSingleton<IDirectoryResolver>(dirResolver);

			//// Let's create the singleton, Lucene indexer
			//Indexer idx = new Indexer(dirResolver);

			//// Register the indexer.
			//container.RegisterSingleton<IIndexer>(idx);
			//// Register the searcher.
			//container.RegisterSingleton<ISearcher>(idx);

			base.Configure(container);
		}

		public override void ValidateRequirements(IList<ApplicationRequirement> feedback) { }
	}
}